﻿<%@ Page Language="C#" MasterPageFile="~/App_Master/AdminMaster2.master" AutoEventWireup="true"
    CodeFile="Produt_List.aspx.cs" Inherits="management_Produt_Produt_List" Title="产品展示" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <link href="../Css/Main.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div class="Header">
        <div class="header_Sub font14px clear">
            <ul>
                <li>产品管理</li>
                <li>产品列表</li>
            </ul>
        </div>
        <div class="header_Foot">
            <ul>
                <li><a href="Produt_Add.aspx" class="Info_Add">添加信息</a></li> 
                <li class="bgColorG">
                    <asp:LinkButton ID="btn_Delete" runat="server" CssClass="Info_Del" Text="删除信息" OnClick="btn_Delete_Click"
                        OnClientClick="return confirm('确定要删除吗?');" /></li>
                  <li style="width: 300px;">&nbsp;产品分类：
                    <asp:DropDownList ID="dropCategory" runat="server" CssClass="droplsit" AutoPostBack="True"
                        OnSelectedIndexChanged="dropCategory_SelectedIndexChanged"/>
                </li> 
            </ul>
           
        </div>
    </div>
    <div class="container">
        <div class="gridbox">
            <asp:GridView ID="G1" runat="server" CssClass="mygrid" AutoGenerateColumns="false"
                DataKeyNames="Id" GridLines="None" OnRowDeleting="G1_DeleteCommand">
                <Columns>
                    <asp:TemplateField>
                        <HeaderTemplate>
                            <input name="selectall" type="checkbox" value="全选" onclick="selall(this)" />全选
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:CheckBox ID="Remove" runat="server" onclick="selectObj(this)" />
                            <%# (this.AspNetPager1.CurrentPageIndex - 1) * this.AspNetPager1.PageSize + Container.DataItemIndex + 1%>
                            <asp:Image ID="myimg" runat="server" ImageUrl='<%#Eval("ImageUrl") %>' Visible="false" />
                            <asp:Image ID="myimg1" runat="server" ImageUrl='<%#Eval("ImageUrl_big") %>' Visible="false" />
                            <asp:Image ID="myimg2" runat="server" ImageUrl='<%#Eval("ImageUrl_bigger") %>' Visible="false" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="产品标题">
                        <ItemTemplate>
                            <a href='Produt_Edit.aspx?p=<%#Eval("Id") %>&c=<%#Eval("CId") %>'>
                                <%#Eval("Title") %></a>&nbsp;
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="图片预览">
                        <ItemTemplate>
                            <a href="<%#Eval("ImageUrl_Big")%>" target="_blank">
                                <img src="<%#Eval("ImageUrl")%>" width="120" height="50" style="margin: 2px; border: 1px solid #cccccc;" /></a>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="所需积分">
                        <ItemTemplate>
                            <%#Eval("Price") %>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="库存">
                        <ItemTemplate>
                            <%#Eval("KuCun") %>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="参与兑换人数">
                        <ItemTemplate>
                            <%#Eval("CanyuUser") %>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="添加时间">
                        <ItemTemplate>
                            <%#Eval("UpTime") %>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="是否推荐"> 
                        <ItemTemplate>
                            <%#Eval("IsRecommend").ToString() == "True" ? "<img src=\"../Css/images/yesok.gif\" />" : "<img src=\"../Css/images/yesno.gif\" />"%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="排序">
                        <ItemTemplate>
                            <%#Eval("Sortid")%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="操作">
                        <ItemTemplate>
                            <a href='Produt_Edit.aspx?p=<%#Eval("Id") %>&c=<%#Eval("CId") %>'>修改</a>·
                            <asp:LinkButton ID="btnDelete" runat="server" Text="删除" CommandName="Delete" OnClientClick="return confirm('确认要删除此行信息吗？')" />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <EmptyDataTemplate>
                    <p>
                        ^_^ 暂无信息发布
                    </p>
                </EmptyDataTemplate>
            </asp:GridView>
            <div class="black2">
                <webdiyer:AspNetPager ID="AspNetPager1" runat="server" NumericButtonTextFormatString="{0}"
                    OnPageChanging="AspNetPager1_PageChanging" ShowFirstLast="False" ShowInputBox="Never"
                    PageSize="14" HorizontalAlign="Center" CssClass="disabled" CurrentPageButtonClass="current">
                </webdiyer:AspNetPager>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        var ie = navigator.appName == "Microsoft Internet Explorer" ? true : false;

        function keyDown(e) {
            if (!ie) {
                var nkey = e.which;
                var iekey = '现在是ns浏览器';
                var realkey = String.fromCharCode(e.which);
            }
            if (ie) {
                var iekey = event.keyCode;
                var nkey = '现在是ie浏览器';
                var realkey = String.fromCharCode(event.keyCode);
             //   if (event.keyCode == 32) { realkey = '\' 空格\'' }
             //   if (event.keyCode == 13) { realkey = '\' 回车\'' }
            //    if (event.keyCode == 16) { realkey = '\' Shift\'' }
            //    if (event.keyCode == 17) { realkey = '\' Ctrl\'' }
            //    if (event.keyCode == 18) { realkey = '\' Alt\'' }
            //    if (event.keyCode == 27) { realkey = '\' Esc\''}
                if (event.keyCode == 27) {
                    document.getElementById('plhidden').style.display = "none";
                }
                if (event.keyCode == 17) {
                    document.getElementById('plhidden').style.display = "";
                }
            }
          //  alert('ns浏览器中键值:' + nkey + '\n' + 'ie浏览器中键值:' + iekey + '\n' + '实际键为' + realkey);
        }
        document.onkeydown = keyDown; 


    </script>
</asp:Content>
